import java.io.*;
import java.util.Scanner;

public class DelectTxt {
    public static void main(String[] args) {
        File file = new File("delect.txt");
        Scanner in = new Scanner(System.in);
        String delectstr = in.next();
        try {
            Reader reader = new FileReader(file);
            BufferedReader bufferedReader = new BufferedReader(reader);
            Writer writer = new FileWriter(file,true);
            BufferedWriter bufferedWriter = new BufferedWriter(writer);
            String str = null;
            String[] strs = null;
            int n = 0;
            str = bufferedReader.readLine();
            strs = str.split(" ");
            while (n < strs.length) {
                if (!strs[n].equals(delectstr)) {
                    System.out.println(strs[n]);
                    bufferedWriter.write(strs[n] + " ");
                }
                n++;
            }
            bufferedReader.close();
            bufferedWriter.close();
        }
        catch (IOException e){
            System.out.println(e.toString());
        }
    }
}
